//
// helloworld.cc
//

#include "helloworld.h"
#include <iostream>


HelloWorld::HelloWorld(void) : mp_window(0), mp_button(0)
{
    m_glade_dir_path = (Glib::file_test("img/helloworld.glade", Glib::FILE_TEST_EXISTS) ? "img" : DATADIR "/helloworld");
    
    mr_builder = Gtk::Builder::create_from_file(Glib::build_filename(m_glade_dir_path, "helloworld.glade"));
    mr_builder->get_widget("window", mp_window);
    mr_builder->get_widget("button", mp_button);
    
    mp_button->signal_clicked().connect(sigc::mem_fun(*this, &HelloWorld::on_button_clicked));
    
    mp_window->show_all();
}

HelloWorld::~HelloWorld(void)
{
}

void  HelloWorld::on_button_clicked(void)
{
    std::cout << "Hello World" << std::endl;
}
